if(!window.console){
	 window.console =new function(){
		 this.log = function (msg){
				//alert(msg);
		 }
	 };
}

/*
 * 屏幕居中打开窗口
 * */
function centerOpen(page,wid,hig)
{
  var x = screen.availWidth/2 - wid/2;
  var y = screen.availHeight/2 - hig/2;
  window.open (page,
               "winName",
			   "height="+wid+", width="+hig+",top="+y+",left="+x+",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no") ;
}
/*
 * 打开日历对话框
 * */
function ontime(box,page){
	window.dateField =box   
	var w=window.screen.width/2 - 170;  
	var h=window.screen.height/2 - 130;
	calendar=window.showModalDialog(page,box,"dialogWidth:340px;dialogHeight:280px;dialogLeft:"+w+";dialogTop:"+h+";status:0;location:0;toolbar:0;menubar:0;resizable:0;scrollbars:no");
}

function openPostWindow(url, data, name){
	//console.log(data);
	var randomNum = Math.floor(Math.random()*1000);
	data += ("&r=" + randomNum);
	name += randomNum;
	var tempForm = document.createElement("form");
	document.body.appendChild(tempForm);   
	tempForm.id = "tempForm1";    
	tempForm.method = "post";    
	tempForm.action = url;  
	tempForm.target = name;
	if(typeof data === "string"){
		var params = data.split("&");
		for(var i=0; i<params.length; i++){
			var nAndV = params[i].split("=");
			var hideInput = document.createElement("input");
			hideInput.type = "hidden";
			hideInput.name = nAndV[0];
			hideInput.value = nAndV[1] ? nAndV[1] : "";
			tempForm.appendChild(hideInput);
		}
	}
	window.open('about:blank',name);
	tempForm.submit();
	document.body.removeChild(tempForm);
}  
